From 2331b8939a487740ea5ffabc6f7cab98b0ab1db7 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 3 Sep 2014 11:54:47 -0700 Subject: [PATCH] Re-enable passing -g to rustc Now that there is a way to disable debuginfo for a build, we can go back to passing it by default. Any bugs in debuginfo will get weeded out by specifying `debug = false` in the profile. --- src/cargo/ops/cargo_rustc/mod.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/cargo/ops/cargo_rustc/mod.rs b/src/cargo/ops/cargo_rustc/mod.rs index 8d342fa7d..a4d1c60af 100644 --- a/src/cargo/ops/cargo_rustc/mod.rs +++ b/src/cargo/ops/cargo_rustc/mod.rs @@ -332,12 +332,9 @@ fn build_base_args(cx: &Context, mut cmd: ProcessBuilder, cmd = cmd.arg("--opt-level").arg(profile.get_opt_level().to_string()); } - // Right now -g is a little buggy, so we're not passing -g just yet - // if profile.get_debug() { - // into.push("-g".to_string()); - // } - - if !profile.get_debug() { + if profile.get_debug() { + cmd = cmd.arg("-g"); + } else { cmd = cmd.args(["--cfg", "ndebug"]); } -- 2.30.2